package com.king.java.tools.email.impl;

import com.king.java.tools.email.SimpleEmailConfig;

/**
 * 描述:
 *
 * @author : sujinchen
 * @date : 2020/10/13
 */
public class GeneralEmailConfig implements SimpleEmailConfig {
    /**
     * 邮箱端口
     */
    private int port = 465;
    /**
     * 邮件服务器地址,默认使用企业邮箱
     */
    private String host="smtp.exmail.qq.com";
    /**
     * 邮件发送协议
     */
    private String transportProtocol="smtp";
    /**
     * 是否需要验证用户名密码,默认需要
     */
    private boolean auth = true;

    /**
     * 发件人账户名
     */
    private String senderAccount;
    /**
     * 发件人账户密码
     */
    private String senderPassword;

    /**
     * 是否启用加密
     */
    private boolean isSSL = false;

    /**
     * 是否开启debug模式
     */
    private boolean isDebug = true;

    /**
     * 邮件编码
     */
    private String encode="UTF-8";


    public GeneralEmailConfig(String senderAccount, String senderPassword) {
        this.senderAccount = senderAccount;
        this.senderPassword = senderPassword;
    }



    public int getPort() {
        return port;
    }

    public String getHost() {
        return host;
    }

    public String getTransportProtocol() {
        return transportProtocol;
    }

    public boolean isAuth() {
        return auth;
    }

    public String getSenderAccount() {
        return senderAccount;
    }

    public String getSenderPassword() {
        return senderPassword;
    }

    public boolean isSSL() {
        return isSSL;
    }

    public boolean isDebug() {
        return isDebug;
    }

    public String getEncode() {
        return encode;
    }

    @Override
    public void setSenderAccount(String senderAccount) {
        this.senderAccount = senderAccount;
    }

    @Override
    public void setSenderPassword(String senderPassword) {
        this.senderPassword = senderPassword;
    }

    @Override
    public void setPort(int port) {
        this.port = port;
    }

    @Override
    public void setHost(String host) {
        this.host = host;
    }

    @Override
    public void setTransportProtocol(String transportProtocol) {
        this.transportProtocol = transportProtocol;
    }

    @Override
    public void setAuth(boolean auth) {
        this.auth = auth;
    }

    @Override
    public void setSSL(boolean SSL) {
        this.isSSL = SSL;
    }

    @Override
    public void setDebug(boolean debug) {
        this.isDebug = debug;
    }

    @Override
    public void setEncode(String encode) {
        this.encode = encode;
    }
}
